package com.example.personnel_oa.controller;


import com.example.comment_oa.pojos.JobRecord;
import com.example.comment_oa.response.AjaxResponse;
import com.example.personnel_oa.service.JobRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("personnelOa")
public class JobRecordController {
    @Autowired
    JobRecordService jobRecordService;
    //新增一条岗位发布记录
    @PostMapping("jobRecord/add")
    public AjaxResponse addjobRecord(@RequestBody JobRecord jobRecord){
        int addjobrecord = jobRecordService.addjobrecord(jobRecord);
        return AjaxResponse.success(jobRecord);

    }
    //新增一条岗位撤回记录
    @PostMapping("jobRecord/addchehui")
    public AjaxResponse addjobRecord2(@RequestBody JobRecord jobRecord){
        int addjobrecord = jobRecordService.addjobrecord2(jobRecord);
        return AjaxResponse.success(jobRecord);

    }
    //新增一条岗位重新发布记录
    @PostMapping("jobRecord/add3")
    public AjaxResponse addjobRecord3(@RequestBody JobRecord jobRecord){
        int addjobrecord = jobRecordService.addjobrecord3(jobRecord);
        return AjaxResponse.success(jobRecord);

    }
    //新增一条岗位需求关闭发布记录
    @PostMapping("jobRecord/add4")
    public AjaxResponse addjobRecord4(@RequestBody JobRecord jobRecord){
        int addjobrecord = jobRecordService.addjobrecord4(jobRecord);
        return AjaxResponse.success(jobRecord);

    }

}
